
//页面跳转函数
export const routerTo=(url,type="navigateTo")=>{
	if(type=="navigateTo"){
		uni.navigateTo({
			url,
			fail: (err) => {
				console.log(err)
				routerTo(url,"reLaunch")
			}
		})
	}else if(type=="reLaunch"){
		uni.reLaunch({
			url
		})
	}else if(type="redirectTo"){
		uni.redirectTo({
			url,
			fail: (err) => {
				routerTo(url,"reLaunch")
			}
		})
	}
}


/**
 * 轻提醒
 * @param {String | Object} options
 * @param {String} options.title
 */
export function showToast(options = '') {
  if (typeof options === 'string') options = {title: options}

  const {title = "", duration = 2500, icon = "none", mask = false} = options

  return uni.showToast({
    title,
    icon,
    mask,
    duration,
    ...options
  })
}

